package com.thyme.content.controller.content;

import com.thyme.content.domain.dto.content.ShareAuditDTO;
import com.thyme.content.domain.entity.content.Share;
import com.thyme.content.service.content.ShareService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author thyme
 * @ClassName ShareAdminController
 * @Description TODO
 * @Date 2019/12/2 21:04
 */
@RestController
@RequestMapping("/admin/shares")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ShareAdminController {

    private final ShareService shareService;

    @PutMapping("/audit/{id}")
    public Share auditById(@PathVariable Integer id,
                           @RequestBody ShareAuditDTO auditDTO) {
        // todo 认证、授权
        return this.shareService.auditById(id,auditDTO);
    }
}
